<?php $flashMessages = Yii::app()->user->getFlashes(); ?>
<?php if ($flashMessages) : ?>
    <?php foreach ($flashMessages as $key => $err) : ?>
	<?php $type = strpos($key, '#') !== false ? 'success' : 'error'; ?>
	<div class=" flashMessages alert-message block-message <?php echo $type; ?>">        
	    <?php echo $err; ?>
	</div>
    <?php endforeach; ?>
<?php endif; ?>